<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/context/mytags.jsp"%>
<t:base type="jquery,easyui,tools,DatePicker"></t:base>
<div class="easyui-layout" fit="true">
<div region="center" style="padding: 1px;">
<t:datagrid name="inAccountDetailList" title="内部账户交易明细查询"  onLoadSuccess="onLoadSuccess" autoLoadData="false" actionUrl="judicialControll.do?inAccountDetailQuery"  fitColumns="false"
	idField="id" fit="true" queryMode="group"  showText="true">
	<%--   update-end--Author:tanghan  Date:20130713 for添加checkbox--%>
	<t:dgCol title="账号" field="acctno"  hidden="false" width="120"></t:dgCol>
	<t:dgCol title="户名" field="acctna"   width="120"></t:dgCol>
	<%--  
	<t:dgCol title="核算机构" field="acctbrh" width="100" ></t:dgCol>
	--%>
	<t:dgCol title="余额" field="tranbl"    width="80"></t:dgCol>
	<t:dgCol title="交易日期" field="trandt" width="100"></t:dgCol>
	
	<t:dgCol title="rowkey" field="rowkey" hidden="true" width="120"></t:dgCol>
	<t:dgCol title="交易流水" field="transq" width="100"></t:dgCol>
	<t:dgCol title="摘要" field="valuna" width="100"></t:dgCol>
	<t:dgCol title="借方发生额" field="loanline" width="80"></t:dgCol>
	<t:dgCol title="贷方发生额" field="lenderline" width="80"></t:dgCol>
	<t:dgCol title="币种" field="crcycd" width="80" ></t:dgCol>
	<t:dgCol title="余额方向" field="blncdn"></t:dgCol>
	<t:dgCol title="账单流水" field="billsq" width="60" ></t:dgCol>
	<t:dgCol title="对方账号"  field="toacct" width="100"></t:dgCol>
	<t:dgCol title="对方户名" field="toacna"  width="60"></t:dgCol>
	<t:dgCol title="交易机构" field="tranbrnm" width="100" ></t:dgCol>
	<t:dgCol title="备注" field="dscrtx" width="60" ></t:dgCol>
	<%--
	<t:dgToolBar title="导出Excel" icon="icon-search" onclick="inAccountDetailListExportXls();"></t:dgToolBar>
	 --%>
</t:datagrid>
<div id="inAccountDetailListtb" style="padding: 3px; height: 65px">
	<div align="left">
		账号:<input id ="acctno" name="acctno">
	           户名:<input id ="acctna" name="acctna">
	           核算机构: <select class="easyui-combotree" data-options="url:'departController.do?getTree', cascadeCheck:false"
                        id="orgSelect" name="orgSelect" datatype="select1">
                    <c:forEach items="${departList}" var="depart">
                        <option value="${depart.orgCode }">${depart.departname}</option>
                    </c:forEach>
                </select>
             <input id="acctbrh" name="acctbrh" type="hidden">
             金额:<input id ="tranbl_begin" name="tranbl_begin">~<input id ="tranbl_end" name="tranbl_end">
	   交易日期:<input id ="trandt_begin" name="trandt_begin">~<input id ="trandt_end" name="trandt_end">
	</div>
	<div align="right">
		<a href="#" class="easyui-linkbutton" iconCls="icon-search" onclick="inAccountDetailListsearch();">查询</a>
	</div>
	<div align="left">
		<a href="#" class="easyui-linkbutton" iconCls="icon-putout" onclick="inAccountDetailListExportXls();">导出</a>
	</div>
</div>
</div>
</div>
<script type="text/javascript">
  $(document).ready(function(){
		$("input[name='trandt_begin']").attr("class","Wdate").attr("style","height:20px;width:90px;").click(function(){WdatePicker({dateFmt:'yyyyMMdd'});});
		$("input[name='trandt_end']").attr("class","Wdate").attr("style","height:20px;width:90px;").click(function(){WdatePicker({dateFmt:'yyyyMMdd'});});
		$("input[name='tranbl_begin']").attr("style","height:20px;width:90px;");
		$("input[name='tranbl_end']").attr("style","height:20px;width:90px;");
	});
	function isNull(pa){
	  var resp='';
	  if(pa ==null || pa==''){
	    resp+=';';
	  }else{
	  	resp+=pa+ ';';
	  }
	   return resp;
	}
    function getParams(){
		var param;
	    var acctno= $("input[name='acctno']").val();
	    var acctna= $("input[name='acctna']").val();
	    var tranbl= $("input[name='tranbl']").val();
	    var acctbrh= $("input[name='acctbrh']").val();
	    var trandt_begin= $("input[name='trandt_begin']").val();
	    var trandt_end= $("input[name='trandt_end']").val();
	    var tranbl_begin= $("input[name='tranbl_begin']").val();
	    var tranbl_end= $("input[name='tranbl_end']").val();
	    
	    param =isNull(acctno) + isNull(acctna) + isNull(tranbl) + isNull(acctbrh)
	               + isNull(trandt_begin) + isNull(trandt_end) + isNull(tranbl_begin) + isNull(tranbl_end);
        return param;
    }
    
    
    function onLoadSuccess(){
       var startkey = getrowkey(1);
       var endkey = getrowkey(0);
       $('#inAccountDetailList').datagrid('options').queryParams={'startkey':startkey,'endkey':endkey,'param':getParams()};
       
    }
    function getrowkey(flag){
        var  rowkey;
    	var datas = $('#inAccountDetailList').datagrid('getRows');
    	var le ;
    	if(flag==0){//下一页
    	   le = $('#inAccountDetailList').datagrid('getData').rows[datas.length-1];
    	}else if(flag==1){//上一页
    	   le = $('#inAccountDetailList').datagrid('getData').rows[0];
    	}else{
    	  le ='';
    	  return '';
    	}
    	if(null != le && le !=''){
	    	for(var i in le){
	    		if(i=='rowkey'){
	    			rowkey=le[i];
    				return rowkey;
	    		}
	    	}
    	}
    }
    function inAccountDetailListExportXls(){
        var param = getParams();
    	JeecgExcelExport("judicialControll.do?inAccountDetailDown&param="+param,"inAccountDetailList");
    }
    function inAccountDetailListsearch(){
    	var param = getParams();
	    
    	$('#inAccountDetailList').datagrid({
    		url: 'judicialControll.do?inAccountDetailQuery&param='+param+'&field=acctno,acctna,startdt,enddt,acctbrh,tranbl,tranbl_begin,tranbl_end,trandt,trandt_begin,trandt_end,rowkey,transq,valuna,loanline,lenderline,crcycd,blncdn,billsq,toacct,toacna,tranbr,dscrtx,tranbrnm,'
    	});
    	
    }
</script>